package com.per.mybootall.config;

import org.apache.http.HttpHost;
import org.elasticsearch.client.Client;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.swing.text.Highlighter;


/**
 * es配置类，注入spring
 * */
@Configuration
public class ElasticSearchClientConfig {
    @Bean
    public RestHighLevelClient restHighLevelClient(){
        RestHighLevelClient restHighLevelClient=new RestHighLevelClient(
                RestClient.builder(
                        new HttpHost("150.158.98.73",9200,"http")
                ));
        return restHighLevelClient;
    }
}
